package main

import (
	"github.com/micro/go-web"
	"lab-service/api/gin"
	"lab-service/config"
	"log"
)

func main() {
	// Get service config
	srvConfig := config.GetConfig().ApiService

	// Create service
	service := web.NewService(
		web.Name(srvConfig.Name),
		web.Version(srvConfig.Version),
	)

	service.Init()

	// Register Handler
	service.Handle("/", gin.Router())

	// Run server
	if err := service.Run(); err != nil {
		log.Fatal(err)
	}
}
